package com.avantis.common.entity;

import com.avantis.common.entity.base.BaseEntity;
import com.avantis.common.utils.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.avantis.common.utils.Constants;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName User
 * @Description 用户
 * @Author kirago
 * @Date 2018/11/26 18:15
 * @Version 1.0
 **/
@Data
@Entity
public class User extends BaseEntity implements Serializable {

	@Column(unique = true, nullable = false)
	private String userName;

	@Column(nullable = false)
	@JsonIgnore
	private String password;

	@Column(nullable = false)
	@JsonIgnore
	private String email;

	@Column(nullable = false)
	@JsonFormat(pattern = DateUtils.DEFAULT_DATETIME_FORMAT, timezone = "GMT+8")
	private Date initTime;

	//是否被禁用，默认为1：开启
	@Column(nullable = false)
	private Integer enable = 1;

}
